while True:
    try:
        num_1 = input("请输入第一个数字：")
        num_2 = input("请输入第二个数字：")
        sum = int(num_1) + int(num_2)
        print("两个数字的和是：" + str(sum))
        break
    except ValueError:
        print("请输入纯数字。")
# try:
#     with open("D:\\Python\\projects\\python_01\\files\\dogs.txt", 'r', encoding='utf-8') as dog:
#         with open("D:\\Python\\projects\\python_01\\files\\cats.txt", 'r', encoding='utf-8') as cat:
#             for d,c in zip(dog.readlines(),cat.readlines()):
#                 print(d)
#                 print(c)
# except FileNotFoundError:
#     # pass
#     print("文件未找到...")
# try:
#     with open('D:\\Python\\projects\\python_01\\files\\book.txt', 'r', encoding='utf-8') as book:
#         contents = book.read()
# except IOError:
#     print("The file is not exist.")
# else:
#     content_1 = contents.count('the')
#     print("The file has "+str(content_1)+" 'the' words.")
#     content_2 = contents.lower().count('the')
#     print("The file has "+str(content_2)+" 'The' words.")
